<?php
class LoginModel extends Model{
	protected $tableName = 'member';
	
	// 自动验证设置
	protected $_validate	 =	 array(
	array('email','require','Email must be not null.'),
	array('email','email','Email format is incorrect'),
	array('password','require','Password must be not null.'),
	);
	//自动填充设置
	public $_auto		=	array(
	array('password','pwdHash',self::MODEL_BOTH,'callback'),
	array('login_time','get_client_time',self::MODEL_BOTH,'function'),//user operate
	array('update_time','get_client_time',self::MODEL_BOTH,'function'),
	array("login_ip","get_client_ip",self::MODEL_BOTH,"function"),
	);
	protected function pwdHash() {
		if(isset($_POST['password'])) {
			return pwdHash($_POST['password']);
		}else{
			return false;
		}
	}
}

?>